package com.wn.prodmanagement.web;

import com.wn.common.ResponseEntity;
import com.wn.entity.MaterialApplication;
import com.wn.prodmanagement.service.MaterialApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: pms
 * @ClassName MaterialApplicationController
 * @description:
 * @author: LRW
 * @create: 2022-10-26 21:17
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ma")
public class MaterialApplicationController {

    @Autowired
    private MaterialApplicationService materialApplicationService;

    @PostMapping("/add")
    public ResponseEntity add(@RequestBody MaterialApplication materialApplication){
        materialApplicationService.add(materialApplication);
        return ResponseEntity.success;
    }

    @PostMapping("/update")
    public ResponseEntity update(@RequestBody MaterialApplication materialApplication){
        materialApplicationService.update(materialApplication);
        return ResponseEntity.success;
    }

    @GetMapping("/list/{pageSize}/{currPage}")
    public ResponseEntity list(@RequestBody MaterialApplication materialApplication,
                               @PathVariable int pageSize,
                               @PathVariable int currPage){
        return ResponseEntity.fail;
    }

}
